/**
 * Copyright (C), 2015-2019, XXX有限公司
 * FileName: Employee
 * Author:   zhouheng
 * Date:     2019/4/5 9:01
 * Description: 员工类
 * History:
 * <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.extern.slf4j.Slf4j;

import java.util.Objects;

import static javax.accessibility.AccessibleState.BUSY;
import static jdk.nashorn.internal.runtime.regexp.joni.constants.StackPopLevel.FREE;

/**
 * 〈一句话功能简述〉<br> 
 * 〈员工类〉
 *
 * @author zhouheng
 * @create 2019/4/5
 * @since 1.0.0
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class Employee {
    private String id;
    private String name;
    private Double salary;
    private Integer age;
    private Status status;


    public enum Status{
        FREE,BUSY,VOCATION;
    }

    @Override
    public int hashCode() {
        final int salary = 31;
        int result = 1;
        result = salary * result + age;
        result = salary * result;
        result = salary * result + ((name == null) ? 0 : name.hashCode());
        long temp;
        temp = Double.doubleToLongBits(salary);
        result = salary * result + (int) (temp ^ (temp >>> 32));
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        Employee other = (Employee) obj;
        if (age != other.age)
            return false;
        if (id != other.id)
            return false;
        if (name == null) {
            if (other.name != null)
                return false;
        } else if (!name.equals(other.name))
            return false;
        if (Double.doubleToLongBits(salary) != Double.doubleToLongBits(other.salary))
            return false;
        return true;
    }


}